﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom;
using NHibernate.Cfg.MappingSchema;

namespace MVCGen.Generators.Entity {
	public class HbmIdToFieldGenerator : ICodeTypeMemberGenerator {
		private HbmId id;

		public HbmIdToFieldGenerator(HbmId id) {
			this.id = id;
		}

		public CodeTypeMember Generate() {
			CodeMemberField result = new CodeMemberField() {
				Name = id.name.MakeFieldName(),
				Type = new CodeTypeReference(id.type),
				Attributes = MemberAttributes.Private
			};
			return result;
		}
	}
}
